package com.baijiaoxi.common.model.query;

import lombok.Data;

import java.util.List;

@Data
public class DynamicQuery extends DynamicCondition<DynamicQuery> {

    public DynamicQuery() {
    }

    public DynamicQuery(String propertyName, String method, String value) {
        this.propertyName = propertyName;
        this.method = method;
        this.value = value;
    }

    public DynamicQuery(String propertyName, String method) {
        this.propertyName = propertyName;
        this.method = method;
    }

    public DynamicQuery addChild(DynamicQuery child) {
        this.children.add(child);
        return this;
    }

    public DynamicQuery addChild(List<DynamicQuery> children) {
        this.children.addAll(children);
        return this;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}

